{include file="common/header"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <form action="" class="layui-form">
                        <div class="layui-inline">
                          <div class="layui-input-inline">
                            <input type="text" name="" id="keys" lay-verify="required" placeholder="请输入" class="layui-input">
                          </div>
                          <input type="button" id="searchBtn" name="submit" class="layui-btn" value="搜索">
                        </div>
                      </form>
                    </div>
                    <div class="layui-row">
                        <table class="layui-table" id="list" lay-filter="list"></table>
                    </div>
                </div>
            

            </div>
        </div>        
    </div>
</div>

<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-group">
        <a href="javascript:;" class="layui-btn layui-btn-sm" onclick="open_frame('{:lang('add')}会员等级','{:url("add")}');"><i class="layui-icon layui-icon-add-circle"></i>{:lang('add')}会员等级</a>
    </div>
    
</script>



<script type="text/html" id="action">
    <div class="layui-btn-group">
        <a class="layui-btn  layui-btn-xs"  onclick="open_frame('{:lang('edit')}','{:url("edit")}?id={{d.id}}');">{:lang('edit')}</a>
        <a data-href="{:url('del')}?id={{d.id}}" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>
    </div>
</script>
<script type="text/html" id="status">
    <input data-href="{:url('state')}" type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
</script>

{include file="common/footer"/}
<script>
    var table;
    layui.use(['table'], function () {
        table = layui.table;
        table.render({
            elem: '#list',
            url: '{:url("index")}',
            method: 'post',
            toolbar: '#toolbarDemo',
            defaultToolbar: [],
            cols: [[
                {checkbox: true, fixed: true},
                {field: 'id', title: 'ID', width: 80, fixed: true, sort: true},
                {field: 'level_name', title: '名称' },
                {field: 'description', title: '描述', width: 150},
                {field: 'status', title: '状态', width: 180, templet:'#status'},
                {field: 'create_time', title: '添加时间'},
                {field: 'update_time', title: '修改时间'},
                {title:'操作',width:150, align:'center', toolbar: '#action'}

            ]],

            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true
        });


    });


</script>